﻿<UserControl x:Class="Lime49.UI.FilePicker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:lex="http://schemas.root-project.org/xaml/presentation"
    xmlns:props="clr-namespace:LockCrypt.Properties"
    x:Name="root">
    <UserControl.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Open" Executed="BrowseForDBFile" />
    </UserControl.CommandBindings>
    <UserControl.Resources>
        <props:Settings x:Key="settings"/>
    </UserControl.Resources>
    <Grid DataContext="{StaticResource settings}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" SharedSizeGroup="labels"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Content="{Binding ElementName=root,Path=LabelText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
        <TextBox x:Name="txtPath" Grid.Row="0" Grid.Column="1" TabIndex="1" Text="{Binding ElementName=root,Path=SelectedPath,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
        <ComboBox x:Name="cboPath" Grid.Row="0" Grid.Column="1" IsEditable="True" TabIndex="2"
                              Text="{Binding ElementName=root,Path=SelectedPath,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
        <Button Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Command="ApplicationCommands.Open" Content="{lex:LocText LockCrypt.Core:Strings:Browse}" TabIndex="3"/>
    </Grid>
</UserControl>
